package com.ljw.community;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@SpringBootApplication
public class CommunityApplication implements WebMvcConfigurer {

    public static void main(String[] args) {
        SpringApplication.run(CommunityApplication.class, args);
    }

    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
        registry.addViewController("/").setViewName("/user/login");
        registry.addViewController("/user/register").setViewName("/user/register");
        registry.addViewController("/user/login").setViewName("/user/login");
        registry.addViewController("/user/index").setViewName("/user/index");
        registry.addViewController("/user/addTopic").setViewName("/user/addTopic");
        registry.addViewController("/user/myTopic").setViewName("/user/myTopic");
        registry.addViewController("/user/followedTopic").setViewName("/user/followedTopic");
        registry.addViewController("/user/info").setViewName("/user/info");
        registry.addViewController("/user/topicDetail").setViewName("/user/topicDetail");
        registry.addViewController("/admin/login").setViewName("/admin/login");
        registry.addViewController("/admin/index").setViewName("/admin/index");
    }
}
